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