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