miline.h revision 45e9809aff7304721fddb95654901b32195c9c7a
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCopyright 1994, 1998 The Open Group
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPermission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsyncthe above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsynccopyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsyncdocumentation.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncThe above copyright notice and this permission notice shall be included in
45e9809aff7304721fddb95654901b32195c9c7avboxsyncall copies or substantial portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45e9809aff7304721fddb95654901b32195c9c7avboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
45e9809aff7304721fddb95654901b32195c9c7avboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncExcept as contained in this notice, the name of The Open Group shall not be
45e9809aff7304721fddb95654901b32195c9c7avboxsyncused in advertising or otherwise to promote the sale, use or other dealings
45e9809aff7304721fddb95654901b32195c9c7avboxsyncin this Software without prior written authorization from The Open Group.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Public definitions used for configuring basic pixelization aspects
45e9809aff7304721fddb95654901b32195c9c7avboxsync * of the sample implementation line-drawing routines provided in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * {mfb,mi,cfb*} at run-time.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define OCTANT3 (1 << (XDECREASING|YDECREASING|YMAJOR))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define XMAJOROCTANTS (OCTANT1 | OCTANT4 | OCTANT5 | OCTANT8)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define DEFAULTZEROLINEBIAS (OCTANT2 | OCTANT3 | OCTANT4 | OCTANT5)
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Devices can configure the rendering of routines in mi, mfb, and cfb*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * by specifying a thin line bias to be applied to a particular screen
45e9809aff7304721fddb95654901b32195c9c7avboxsync * using the following function. The bias parameter is an OR'ing of
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the appropriate OCTANT constants defined above to indicate which
45e9809aff7304721fddb95654901b32195c9c7avboxsync * octants to bias a line to prefer an axial step when the Bresenham
45e9809aff7304721fddb95654901b32195c9c7avboxsync * error term is exactly zero. The octants are mapped as follows:
45e9809aff7304721fddb95654901b32195c9c7avboxsync * \ 3 | 2 /
45e9809aff7304721fddb95654901b32195c9c7avboxsync * 4 \ | / 1
45e9809aff7304721fddb95654901b32195c9c7avboxsync * -----------
45e9809aff7304721fddb95654901b32195c9c7avboxsync * 5 / | \ 8
45e9809aff7304721fddb95654901b32195c9c7avboxsync * / 6 | 7 \
45e9809aff7304721fddb95654901b32195c9c7avboxsync * For more information, see "Ambiguities in Incremental Line Rastering,"
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Jack E. Bresenham, IEEE CG&A, May 1987.
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /* bias */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Private definitions needed for drawing thin (zero width) lines
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Used by the mi, mfb, and all cfb* components.
45e9809aff7304721fddb95654901b32195c9c7avboxsync else if ( (_x) >= (_pbox)->x2) (_result) |= OUT_RIGHT; \
45e9809aff7304721fddb95654901b32195c9c7avboxsync else if ( (_y) >= (_pbox)->y2) (_result) |= OUT_BELOW;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MIOUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SWAPINT(i, j) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SWAPPT(i, j) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync 0 : ((_pScreen)->devPrivates[miZeroLineScreenIndex].uval))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SetYMajorOctant(_octant) ((_octant) |= YMAJOR)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define IsXMajorOctant(_octant) (!((_octant) & YMAJOR))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define IsYMajorOctant(_octant) ((_octant) & YMAJOR)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define IsXDecreasingOctant(_octant) ((_octant) & XDECREASING)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define IsYDecreasingOctant(_octant) ((_octant) & YDECREASING)
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*xmin*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*ymin*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*xmax*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*ymax*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int * /*new_x1*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int * /*new_y1*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int * /*new_x2*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int * /*new_y2*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*adx*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*ady*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int * /*pt1_clipped*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int * /*pt2_clipped*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*octant*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int /*bias*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*oc1*/,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int /*oc2*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* MILINE_H */