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